<template>
  <div>
    <div class="header">
        <span class="search-header">搜索用户数</span>
        <i class="el-icon-info" style="color: grey; margin-top: 2px;"></i>
    </div>
    <div class="main">
        <span class="main-title">12321</span>
        <span class="main-content">17.1</span>
        <i class="el-icon-caret-top" style="color:red"></i>
        <i class="el-icon-caret-bottom" style="color:greenyellow"></i>
    </div>
    <div class="footer">
        <div class="charts" ref="charts"></div>
    </div>
  </div>
</template>

<script>
// 引入
import * as echarts from 'echarts'
export default {
  name: "LineCharts",
  mounted() {
    //初始化echarts实例
    let lineCharts = echarts.init(this.$refs.charts);
    //配置数据
    lineCharts.setOption({
      xAxis: {
        //隐藏x轴
        show: false,
        type: "category",
      },
      yAxis: {
        //隐藏y轴
        show: false,
      },
      //系列
      series: [
        {
          type: "line",
          data: [10, 7, 33, 12, 48, 9,29,10,44],
          //拐点的样式的设置
          itemStyle: {
            opacity: 0,
          },
          //线条的样式
          lineStyle: {
            color: "skyblue",
          },
          //填充颜色设置
          areaStyle: {
            color: {
              type: "linear",
              x: 0,
              y: 0,
              x2: 0,
              y2: 1,
              colorStops: [
                {
                  offset: 0,
                  color: "skyblue", // 0% 处的颜色
                },
                {
                  offset: 1,
                  color: "#fff", // 100% 处的颜色
                },
              ],
              global: false, // 缺省为 false
            },
          },
        },
      ],
      //布局调试
      grid: {
        left: 0,
        top: 0,
        right: 0,
        bottom: 0,
      },
    });
  },
};
</script>

<style>
.header {
    display: flex;
    align-items: center;
    font-size: 16px;
    color: gray;
}
.search-header {
    margin-right: 20px;
    font-size: 18px;
}
.main{
    margin: 10px 0px;
}
.main-title{
    margin-right: 30px;
    font-size: 26px;
}
.main-content{
    margin-right: 10px;
    font-size: 20px;
}
.charts {
    width: 100%;
    height: 100px;
}
</style>